/*
    This file is part of Slydini.

    Slydini is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Slydini is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Slydini.  If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MOUSE_H
#define _MOUSE_H

#ifdef LINUX

#include <X11/Xlib.h>

#else

#include <Windows.h>
#include <QtGui>

#endif

#include <vector>
#include <cv.h>

using namespace std;

#define MOUSE_POS_DIFF 2600
#define TRAVEL_TIME 50
#define MOVEMENT 0.1

class Mouse {
	public:
		Mouse(int screen);
		void reset();
		void mouseDown();
		void mouseUp();
		void click();
		void moveMouse(int x, int y);
		void placeMouse(int x, int y);
		int getDesktopHeight();
		int getDesktopWidth();
		CvPoint calculateNewPosition(int x, int y);
	private:
		void mouseClick(int button, int mode);
		int minx, miny, maxx, maxy;
		int desktopWidth, desktopHeight;
		int screen;
#ifdef LINUX
		Display *display;
		Window root;
#endif
		int boxX,boxY;
		bool isDown;
		int lastX, lastY;
};


#endif

